﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace zombie_spel
{
    class Entity
    {
        protected Texture2D texture;
        protected Vector2 position, center, origin, velocity;
        protected float rotation;
        public Vector2 Position
        {
            get { return position; }
        }
        public Vector2 Center
        {
            get { return center; }
        }
        public Texture2D Texture
        {
            get { return texture; }
        }
        public Entity(Texture2D tex, Vector2 pos)
        {
            texture = tex;
            position = pos;
            velocity = Vector2.Zero;

            center = new Vector2(position.X + texture.Width / 2, position.Y + texture.Height / 2);
        }
        public virtual void Update(GameTime gameTime)
        {
            this.center = new Vector2(position.X + texture.Width / 2, position.Y + texture.Height / 2);
        }
        public Rectangle GetRectangle()
        {
            return new Rectangle((int)Position.X, (int)Position.Y, (int)texture.Width, (int)texture.Height);
        }
    }
}
